package com.zhang.productcenter.controller;


import com.zhang.productcenter.manager.IProductBaseManager;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;

/**
 * <p>
 * 商品款式基础表 前端控制器
 * </p>
 *
 * @author KingHood
 * @since 2023-12-20
 */
@RequiredArgsConstructor
@Slf4j
@RestController
@RequestMapping("/productBase")
public class ProductBaseController {

    @Resource
    private IProductBaseManager productBaseManager;

    /**
     * excel导入
     *
     * @param file     文件
     * @param response 响应
     * @author zfj
     * @date 2023/12/25
     */
    @PostMapping("/uploadProduct")
    public void uploadProduct(MultipartFile file, HttpServletResponse response) {

        log.info("uploadProduct:===》导入商品");
        productBaseManager.uploadProduct(file, response);
    }
}
